<?php
use app\admin\model\AuthRule as AuthRuleModel;

if (!AuthRuleModel::where('title', '签到管理')->count()) {

    $parent_id = AuthRuleModel::query()->create([
        'parent_id'    => 0,
        'title'        => '签到管理',
        'url'          => '#',
        'method'       => 'OPTIONS',
        'slug'         => 'sign'
    ]);
    $parent_id_1 =  AuthRuleModel::query()->create([
        'parent_id'    => $parent_id->id,
        'title'        => '签到记录',
        'url'          => 'sign_index',
        'method'       => 'GET',
        'slug'         => 'sign.index'
    ]);
    
}

